package com.faceunity.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.faceunity.entity.AvatarModel;
import com.faceunity.entity.MagicPhotoEntity;

import com.faceunity.greendao.AvatarModelDao;
import com.faceunity.greendao.MagicPhotoEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig avatarModelDaoConfig;
    private final DaoConfig magicPhotoEntityDaoConfig;

    private final AvatarModelDao avatarModelDao;
    private final MagicPhotoEntityDao magicPhotoEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        avatarModelDaoConfig = daoConfigMap.get(AvatarModelDao.class).clone();
        avatarModelDaoConfig.initIdentityScope(type);

        magicPhotoEntityDaoConfig = daoConfigMap.get(MagicPhotoEntityDao.class).clone();
        magicPhotoEntityDaoConfig.initIdentityScope(type);

        avatarModelDao = new AvatarModelDao(avatarModelDaoConfig, this);
        magicPhotoEntityDao = new MagicPhotoEntityDao(magicPhotoEntityDaoConfig, this);

        registerDao(AvatarModel.class, avatarModelDao);
        registerDao(MagicPhotoEntity.class, magicPhotoEntityDao);
    }
    
    public void clear() {
        avatarModelDaoConfig.clearIdentityScope();
        magicPhotoEntityDaoConfig.clearIdentityScope();
    }

    public AvatarModelDao getAvatarModelDao() {
        return avatarModelDao;
    }

    public MagicPhotoEntityDao getMagicPhotoEntityDao() {
        return magicPhotoEntityDao;
    }

}
